package kr.hkit.androidcomplete02.ch13;

import kr.hyunist.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarEx extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbar);

		mProgBar = (ProgressBar) findViewById(R.id.ch13_progressbar);
		mProgCircle = (ProgressBar) findViewById(R.id.ch13_progcircle);
	}

	public void mOnClick(View v) {
		switch (v.getId()) {
		case R.id.ch13_decfirst:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_incfirst:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_decsecond:
			mProgBar.incrementSecondaryProgressBy(-2);
			break;
		case R.id.ch13_incsecond:
			mProgBar.incrementSecondaryProgressBy(2);
			break;
		case R.id.ch13_start:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
		case R.id.ch13_stop:
			mProgCircle.setVisibility(View.INVISIBLE);
			break;
		}
	}
}
